#pragma once
#include <d3dx9.h>



// A generic thing that exists in the gameworld
class GameObject
{
public:
	GameObject(void)
	{
		Position = D3DXVECTOR3(0,0,0);
		Velocity = D3DXVECTOR3(0,0,0);

		RotX = 0;
		RotY = 0;
		RotZ = 0;

		isDead = false;
	}
	virtual ~GameObject(void) {}

	bool isDead;

	D3DXVECTOR3 Position;
	D3DXVECTOR3 Velocity;

	float RotX, RotY, RotZ;

	virtual void Init() {}
	virtual void Update()
	{
		Position += Velocity;
	}
	virtual void Render()=0;

	virtual D3DXMATRIXA16 GetTransform()
	{
		D3DXMATRIXA16 translation, rotation, transform;

		D3DXMatrixRotationYawPitchRoll(&rotation,RotY,RotX,RotZ);

		D3DXMatrixTranslation(&translation,Position.x,Position.y,Position.z);

		transform = rotation * translation;

		return transform;
	}
};
